{% extends "base.html" %}

{% load tags %}

{% block head %}
	<script type="text/javascript" src="/media/javascript/multiline_tooltip.js"></script>
	
	<link rel="stylesheet" href="/media/css/jquery/jquery-ui-1.8.21.custom.css">
    <script src="/media/javascript/jquery-1.7.2.js"></script>
    <script src="/media/javascript/ui/jquery.ui.core.js"></script>
    <script src="/media/javascript/ui/jquery.ui.widget.js"></script>
    <script src="/media/javascript/ui/jquery.ui.datepicker.js"></script>
    <script src="/media/javascript/ui/i18n/jquery.ui.datepicker-pl.js"></script>
    
	<script language="javascript" type="text/javascript">
		<!-- // Hide Javascript
		
			// datepicker 
			
		    $(function() {
				$( "#id_from_d" ).datepicker( $.datepicker.regional[ "pl" ] );
				$( "#id_from_d" ).datepicker( "option", "showAnim", "slideDown" );
				$( "#id_from_d" ).datepicker( "option", "dateFormat", "yy-mm-dd" );

				$( "#id_to_d" ).datepicker( $.datepicker.regional[ "pl" ] );
				$( "#id_to_d" ).datepicker( "option", "showAnim", "slideDown" );
				$( "#id_to_d" ).datepicker( "option", "dateFormat", "yy-mm-dd" );
			});
		    
		    // period change
			function loadPage()
			{
				var period = document.getElementById("id_period").value;
				document.getElementById("id_to_d").disabled = 
					period == 1 ? true : false;
			}
			
			function changePeriod()
			{
				var period = document.getElementById("id_period").value;
				document.getElementById("id_to_d").disabled = 
					period == 1 ? true : false;
			}
			
		-->
	</script>
	<noscript>
		<h3>Ta strona wymaga obsługi Javascript!</h3>
	</noscript>		
  
{% endblock %}

{% block bodyEvent %}
	onLoad="loadPage();"
{% endblock bodyEvent %}

{% block title %}
	System filtrujący
{% endblock title %}

{% block subtitle %}
	Zdefiniuj warunek dotyczący daty nadania wiadomości.
{% endblock subtitle %}

{% block content %}

	<div class="form">
		<form method="post" action="{% url zatwierdz_warunek tmp_ruleid DATE_C condid ruleid %}"> {% csrf_token %}
			<div class="container">
			
				Wiadomość nadano w {{ form.period }}
				: <br/><br/> {{ form.from_d }}
				
				{% if form.from_d.errors %}
					<div id="tooltip_from_d" class="xstooltip">
						{{ form.from_d.errors }}
					</div> 							
					<img
						src="/media/images/warning.png" 
						id="warning_from_d" 
						onmouseover="xstooltip_show('tooltip_from_d', 'warning_from_d', 0, 0);"
						onmouseout="xstooltip_hide('tooltip_from_d');" 
					/>
				{% endif %}
				
				 - {{ form.to_d }}
				
				{% if form.to_d.errors %}
					<div id="tooltip_to_d" class="xstooltip">
						{{ form.to_d.errors }}
					</div> 							
					<img
						src="/media/images/warning.png" 
						id="warning_to_d" 
						onmouseover="xstooltip_show('tooltip_to_d', 'warning_to_d', 0, 0);"
						onmouseout="xstooltip_hide('tooltip_to_d');" 
					/>
				{% endif %}
				 .
				
			</div>
			<input type="submit" name="cancel" id="cancel" class="button" value="anuluj" />
			<input type="submit" name="submit" id="submit" class="button" value="potwierdź" />
		</form>
	</div>
				
{% endblock content %}
{% block backto %}
	{{ begin_backto }}
	<li><a href="/filtr/">lista reguł filtrowania</a></li>
{% endblock %}

{% block help %}
{% endblock help %}
